#include "ConfigSettings.h"
#include <QCoreApplication>

using namespace XQChat;

CConfigSettings* CConfigSettings::m_pConfigSettings = 0;
CConfigSettings* CConfigSettings::getConfigSettings()
{
	if(!m_pConfigSettings)
		m_pConfigSettings = new CConfigSettings;

	return m_pConfigSettings;
}

CConfigSettings::CConfigSettings(void)
{
	m_qsFileName = qApp->applicationDirPath()+"/config.ini";
	m_pSettings = new QSettings(m_qsFileName,QSettings::IniFormat);
}


CConfigSettings::~CConfigSettings(void)
{
}

QVariant CConfigSettings::getValue( const QString& key )
{
	return m_pSettings->value(key);
}

void CConfigSettings::setValue( const QString& key, const QVariant& value )
{
	m_pSettings->setValue(key,value);
}

